//
//  BaseRequest.m
//  suishouxiu
//
//  Created by parkin on 15/5/27.
//  Copyright (c) 2015年 zhongyan. All rights reserved.
//

#import "BaseRequest.h"
#define K_Domain   @"http://www.autoyou.com.cn/"

//#import <SSKeychain.h>
@implementation BaseRequest


- (NSString *)getRequestURL {
    return K_Domain;
}
- (RequestMethodType)getRequestMethod {
    return GetMethod;
}
- (id)getRequestParams {
    NSMutableDictionary * paramDict = [NSMutableDictionary dictionaryWithCapacity:1];
    return paramDict;
}
- (NSString *)getOid {
    return [[NSUserDefaults standardUserDefaults] objectForKey:@"oid"];
}
- (NSDictionary *)getRequestParamFromFile:(NSString *)fileName {
    NSString * path = [[NSBundle mainBundle] pathForResource:fileName ofType:@"json"];
    NSError * error = nil;
    NSData *data = [NSData dataWithContentsOfFile:path];
    NSDictionary * result = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error];
    if (error) {
        NSLog(@"error = %@", error);
        return nil;
    } else {
        return result;
    }
}
- (NSString *)getVersionCode {
    NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleVersionKey];
    return version;
}
- (NSString *)getPlatform {
    return @"ios";
}
/**
 使用uuid + keychain替代udid
 */
- (NSString *)getMacAddress
{
//    NSString *retrieveuuid = [SSKeychain passwordForService:@"com.zhongyan.interactionworks"account:@"uuid"];
//    if ( retrieveuuid == nil || [retrieveuuid isEqualToString:@""])
//    {
//        CFUUIDRef uuid = CFUUIDCreate(NULL);
//        assert(uuid != NULL);
//        CFStringRef uuidStr = CFUUIDCreateString(NULL, uuid);
//        retrieveuuid = [NSString stringWithFormat:@"%@", uuidStr];
//        [SSKeychain setPassword: retrieveuuid
//                     forService:@"com.zhongyan.interactionworks"account:@"uuid"];
//    }
    return @"";
    
}




@end
